<?php
include_once(dirname(__FILE__)."../../_CONFIG/config.php");
include_once(dirname(__FILE__)."../../_AOP/AOP.class.php");

// Create AOP Object to Control the Modules
$AOP = new AOP();
// URL Patter Matcher
$url = explode('/',$_SERVER['REQUEST_URI']); 
$module = $url[$module_name_position];
$page = "index.php";
$page_check = explode("?", $url[$module_name_position+1]);

if(count($page_check)>1){
    $page = $page_check[0];
}
// end of URL Patter Matcher
//die(''.$module.' => '.$page."<br/>");
// Fire AOP
$action = $AOP->FIRE($module,$page);
//print_r($action );
switch ($action){
	case -1:
		die("<script type='text/javascript' >window.location.href='$ERROR_PAGE';</script>");
		break;
	case 0:
		die("<script type='text/javascript' >window.location.href='$LOGIN_PAGE';</script>");
		break;
	case 1:
		//echo '<br/>ok ... '.$module.' is a working one and page '.$page." is opened ;)";
}
	